<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>办公物品清单</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<import type="js" file="js.jquery" />
<import type="js" file="js.common" />
<import type="css" file="css.global" />
<import type="css" file="css.form" />
<script type="text/javascript">
$(document).ready(function(){
	$('.number').blur(function(){
		var number = $(this).val();
		var sum = $(this).next('.sum').val();
		if(number == ""){
			alert('请填写大于0的数字！');
		}else{
			var number = parseInt(number);
			var sum = parseInt(sum);
			if(number<0){
				alert('请填写不大于库存数量的数字！');
			}else if(number>sum){
				alert('请填写不大于库存数量的数字！');	
			}
		}
	});
});

</script>
</head>
<body>
<div class="search">
<form action="" method="post" name="form1" onsubmit="return CheckForm();">
	<b>请填写物品数量</b>
</form>
</div>
<form action="__URL__/supplies_use_insert"  method="post" name="form1" onsubmit="return CheckForm();">
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
    <tr>
		<td width="10%" nowrap align="center">编号</td>
		<td width="25%" nowrap align="center">物品名称</td>
		<td width="35%" nowrap align="center">规格</td>
		<td width="15%" nowrap align="center">单位</td>
		<td width="15%" nowrap align="center">库存</td>
		<td width="15%" nowrap align="center">数量</td>
	</tr>
	</thead>
	<tbody>
	<php>$i=1;</php>
	<volist name="data" id="vo">
    <tr class="TableLine1">
		<td width="10%" nowrap align="center"><input type="hidden" name="supplies_id[]" value="{$vo.id}" >{$vo.id}</td>
		<td width="25%" nowrap align="center">{$vo.supplies_name}</td>
		<td width="35%" nowrap align="center">{$vo.specification}</td>
		<td width="15%" nowrap align="center">{$vo.unit}</td>
		<td width="15%" nowrap align="center">
			<div class="sum1">
			<php>if($vo['sum']<$vo['min_number']){</php>
			<font color="red">{$vo.sum}</font>
			<php>}else{ echo $vo['sum'];}</php></div>
		</td>
		<td width="15%" nowrap align="center"><input type='text' id="number{$i}" class="number" name="number[]" size="3" ><input type="hidden" id="sum" class="sum" value="{$vo.sum}" ></td>
	</tr>
	</volist>
	</tbody>
	<tr class="TableLine1">
		<td width="15%" nowrap align="center" colspan="6">
			<input type="hidden" name="tpl" value="{$tpl}" >
			<input type="hidden" name="count" id="count" value="{$count}" >
			<input type="submit" value="提交" class="BigButton">&nbsp;&nbsp;
	        <input type="button" value="返回" class="BigButton" onClick="history.back();">
		</td>
	</tr>
</table>
</div>
</form>
</body>
</html>